//一般不改
//  PlayerManager.h
//  NewChat
//
//  Created by 马欢 on 16/3/6.
//  Copyright © 2016年 蓝鸥. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "SongModel.h"

@protocol PlayerMangerDelegate <NSObject>

-(void)isPlayingMusicAsTime:(NSString *)timeString;
//当切歌时，代理要实现的方法 //切哪一首歌曲
-(void)didSkippedSong:(SongModel *)song;

@end


@interface PlayerManager : NSObject

+(instancetype)defaultManager;
@property (nonatomic,strong)AVPlayer *player;
@property (nonatomic,strong)NSMutableArray *passModels;//当前播放歌曲数组
@property (nonatomic,assign)NSUInteger currentIndex;//当前index,当前播
@property (nonatomic,assign)NSUInteger lastIndex;//上一首标记
@property (nonatomic,strong)NSString *playMode;//播放模式
//代理
@property (nonatomic,assign)id<PlayerMangerDelegate>didSkippedSongDelegate;
//播放音乐
-(void)musicPlay;
//随机播放一首歌
-(void)playRandom;
//重新播放
-(void)playAgain;
//暂停音乐
-(void)pausePlay;
//上一首
-(void)lastMusic;
//下一首
-(void)nextMusic;
//根据下标，准备要播放的歌曲 //@param index 要播放哪一首
-(void)prepareMusicWithIndex:(NSInteger)index;
// 停止播放器
-(void)stopPlay;
//根据时间，跳转到指定时间播放的音乐
-(void)musicSeekToTime:(float)time;

@end
